package com.heima.StringJoiner方法;

import java.util.StringJoiner;

public class StringJoinerDemo1 {
    public static void main(String[] args) {
        //创建对象
        StringJoiner sj=new StringJoiner(", ","[","]");
        sj.add("aaa").add("bbb").add("ccc");
        int length = sj.length();
        System.out.println(length);
        System.out.println(sj);
        //返回字符串类型
        String s = sj.toString();
        System.out.println(s);
    }
}
